import React from 'react';
// v1 版本
import {TabBarBottom, TabNavigator} from "react-navigation";
import Home from './Home';
import Find from './Find';
import Message from './Message';
import Mine from './Mine';
import TabBarItem from './TabBarItem';

// 注册Tabs
const Tabs = TabNavigator({
		Home: {
			screen: Home,
			navigationOptions: {  // 也可以写在组件的static navigationOptions内
				tabBarLabel: '首页',
				tabBarIcon: ({focused, tintColor}) => (
					<TabBarItem
						tintColor={tintColor}
						focused={focused}
						normalImage={require('./../../../img/tab_home.png')}
						selectedImage={require('./../../../img/tab_home_press.png')}
					/>)
			}
		},
		Find: {
			screen: Find,
			navigationOptions: {
				tabBarLabel: '发现',
				tabBarIcon: ({focused, tintColor}) => (
					<TabBarItem
						tintColor={tintColor}
						focused={focused}
						normalImage={require('./../../../img/tab_find.png')}
						selectedImage={require('./../../../img/tab_find_press.png')}
					/>)
			}
		},
		Message: {
			screen: Message,
			navigationOptions: {
				tabBarLabel: '消息',
				tabBarIcon: ({focused, tintColor}) => (
					<TabBarItem
						tintColor={tintColor}
						focused={focused}
						normalImage={require('./../../../img/tab_message.png')}
						selectedImage={require('./../../../img/tab_message_press.png')}
					/>)
			}
		},
		Mine: {
			screen: Mine,
			navigationOptions: {
				tabBarLabel: '我的',
				tabBarIcon: ({focused, tintColor}) => (
					<TabBarItem
						tintColor={tintColor}
						focused={focused}
						normalImage={require('./../../../img/tab_mine.png')}
						selectedImage={require('./../../../img/tab_mine_press.png')}
					/>)
			}
		}
	},
	{
		tabBarComponent: TabBarBottom,
		tabBarPosition: 'bottom',
		swipeEnabled: false,
		animationEnabled: false,
		lazy: true,
		tabBarOptions: {
			activeTintColor: 'black',
			inactiveTintColor: 'black',
			style: {backgroundColor: 'green'},
		}
	});

const tabPage = {
	Home: {screen: Tabs},
	Find: {screen: Tabs},
	Message: {screen: Tabs},
	Mine: {screen: Tabs}
};

/**
 * 导出当前Module
 */
module.exports = tabPage;